import api from "@/apis/index.js"

var userStore = {
	/**
	 * 在跳转时保存手动模版任务组件中编辑的数据，在跳转回来后取出
	 * @param {Object} data
	 */
	saveHandTemplateViewEditingData(data) {
		uni.setStorageSync("handTemplateViewEditingDataKey", data);
	},
	getHandTemplateViewEditingData() {
		return uni.getStorageSync("handTemplateViewEditingDataKey");
	},
	
	saveTeachWeldingViewEditingData(data) {
		uni.setStorageSync("teachWeldingViewEditingDataKey", data);
	},
	getTeachWeldingViewEditingData() {
		return uni.getStorageSync("teachWeldingViewEditingDataKey");
	},
	
	saveHttpIp(ip) {
		uni.setStorageSync("httpIp", ip);
	},
	getHttpIp() {
		return uni.getStorageSync("httpIp");
	},
	saveHttpPort(port) {
		uni.setStorageSync("httpPort", port);
	},
	getHttpPort() {
		return uni.getStorageSync("httpPort");
	},
	saveHttpRequestUrl(url) {
		uni.setStorageSync("httpUrl", url);
	},
	getHttpRequestUrl() {
		return uni.getStorageSync("httpUrl");
	},
	removeHttpData() {
		uni.removeStorageSync("httpIp")
		uni.removeStorageSync("httpPort")
		uni.removeStorageSync("httpUrl")
	},
	
	removeLocalKey() {
		uni.removeStorageSync("handTemplateViewEditingDataKey")
		uni.removeStorageSync("teachWeldingViewEditingDataKey")
	},
}

export default userStore